import request from '@/utils/request'

// 查询课列表
export function listSch(query) {
  return request({
    url: '/edu/sch/list',
    method: 'get',
    params: query
  })
}

// 查询课详细
export function getSch(couSchId) {
  return request({
    url: '/edu/sch/' + couSchId,
    method: 'get'
  })
}

// 新增课
export function addSch(data) {
  return request({
    url: '/edu/sch',
    method: 'post',
    data: data
  })
}

// 修改课
export function updateSch(data) {
  return request({
    url: '/edu/sch',
    method: 'put',
    data: data
  })
}

// 删除课
export function delSch(couSchId) {
  return request({
    url: '/edu/sch/' + couSchId,
    method: 'delete'
  })
}

// 根据当前用户查询课列表
export function listByUserId(query) {
  return request({
    url: '/edu/sch/list/teacher/student',
    method: 'get',
    params: query
  })
  }
// 学生查询课列表
export function listByStudent(year,semester,week) {
  return request({
    url: `/edu/sch/listByStudent?year=${year}&semester=${semester}&week=${week}`,
    method: 'get',
  })
}

export function listTeacher(year,semester,week) {
  return request({
    url: `/edu/sch/listTeacher?year=${year}&semester=${semester}&week=${week}`,
    method: 'get',
  })
}


export function listSchByUserId() {
  return request({
    url: '/edu/sch/listByUserId',
    method: 'get',
  })
}

export function listByTeacherId() {
  return request({
    url: '/edu/sch/listByTeacherId',
    method: 'get',
  })
}


